From: Florian Müllner Date: Wed, 10 Sep 2014 20:41:40 +0000 (+0200) Subject: global: Filter out destroyed actors from get_window_actors() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2160 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=93205eefb9c55828bf96b17ee3bc239d1e847d1c;p=gnome-shell.git global: Filter out destroyed actors from get_window_actors() All current code assumes that the list of window actors corresponds to the list of windows; however as the list returned by meta_get_window_actors() now includes actors during the destroy animation, that assumption breaks. Eventually we should make everyone move to a more appropriate API, but for now make it work again by returning a filtered list of "good" window actors. https://bugzilla.gnome.org/show_bug.cgi?id=735927 --- diff --git a/src/shell-global.c b/src/shell-global.c index 1e655305d..d90ceaff8 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -735,14 +735,21 @@ shell_global_get_display (ShellGlobal *global) * * Gets the list of #MetaWindowActor for the plugin's screen * - * Return value: (element-type Meta.WindowActor) (transfer none): the list of windows + * Return value: (element-type Meta.WindowActor) (transfer container): the list of windows */ GList * shell_global_get_window_actors (ShellGlobal *global) { + GList *filtered = NULL; + GList *l; + g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL); - return meta_get_window_actors (global->meta_screen); + for (l = meta_get_window_actors (global->meta_screen); l; l = l->next) + if (!meta_window_actor_is_destroyed (l->data)) + filtered = g_list_prepend (filtered, l->data); + + return g_list_reverse (filtered); } static void